﻿package frEngine.animateControler.keyframe
{

    public class BezierVo extends Object
    {
        public var LY:Number;
        public var RY:Number;
        public var LX:Number;
        public var RX:Number;
        private var _leftSize:Number = -1;
        private var _rightSize:Number = -1;
        private var _lineAngle:Number = -1;
        public var isLineTween:Boolean;

        public function BezierVo(param1:Number, param2:Number, param3:Number, param4:Number, param5:Boolean)
        {
            this.LY = param2;
            this.RY = param4;
            this.LX = param1;
            this.RX = param3;
            this.isLineTween = param5;
            return;
        }// end function

        public function getLeftSize(param1:Number, param2:Number) : Number
        {
            var _loc_3:Number = NaN;
            var _loc_4:Number = NaN;
            if (this._leftSize == -1)
            {
                _loc_3 = this.LX * param1;
                _loc_4 = this.LY * param2;
                this._leftSize = _loc_4 * _loc_4 + _loc_3 * _loc_3;
                this._leftSize = Math.sqrt(this._leftSize);
            }
            return this._leftSize;
        }// end function

        public function getRightSize(param1:Number, param2:Number) : Number
        {
            var _loc_3:Number = NaN;
            var _loc_4:Number = NaN;
            if (this._rightSize == -1)
            {
                _loc_3 = this.RX * param1;
                _loc_4 = this.RY * param2;
                this._rightSize = _loc_4 * _loc_4 + _loc_3 * _loc_3;
                this._rightSize = Math.sqrt(this._rightSize);
            }
            return this._rightSize;
        }// end function

        public function getLineAngle(param1:Number, param2:Number) : Number
        {
            if (this._lineAngle == -1)
            {
                this._lineAngle = Math.atan2(this.LY * param2, this.LX * param1);
            }
            return this._lineAngle;
        }// end function

        public function reset(param1:Number, param2:Number, param3:Number) : void
        {
            var _loc_6:int = 0;
            param1 = 0;
            var _loc_4:* = Math.sin(param1);
            var _loc_5:* = Math.cos(param1);
            if (param1 == 0)
            {
                var _loc_6:int = 0;
                _loc_5 = 0;
                _loc_4 = _loc_6;
            }
            this.LY = param2 * _loc_4;
            this.LX = param2 * _loc_5;
            this.RY = (-param3) * _loc_4;
            this.RX = (-param3) * _loc_5;
            this._lineAngle = param1;
            this._leftSize = param2;
            this._rightSize = param3;
            this.isLineTween = param1 == 0 && param2 == 0 && param3 == 0;
            return;
        }// end function

    }
}
